package com.qqtech.qquan.sys.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.qqtech.core.frame.dao.BaseDaoImpl;
import com.qqtech.qquan.sys.model.*;

@Repository
public class SysMenuDaoImpl extends BaseDaoImpl<SysMenu> implements SysMenuDao {
	public static final Logger log = LoggerFactory.getLogger(SysMenuDaoImpl.class);
	
	@Override
	public SysMenuVo getByMenuId(java.lang.String menuId) {
		return sqlSessionTemplate.selectOne(getSqlName("selectByMenuId"), menuId);
	}

	@Override
	public List<SysMenuVo> queryListByParentId(SysMenuQuery sysMenu) {
		return sqlSessionTemplate.selectList(getSqlName("selectByParentId"), sysMenu);
	}

	@Override
	public Integer getMaxOrderIdx() {
		return (Integer) sqlSessionTemplate.selectOne(getSqlName("getMaxOrderIdx"));
	}

	@Override
	public List<SysMenuVo> topMenuForRole(SysMenuQuery sysMenuQuery) {
		return sqlSessionTemplate.selectList(getSqlName("topMenuForRole"), sysMenuQuery);
	}

	@Override
	public List<SysMenuVo> menuForRole(SysMenuQuery sysMenuQuery) {
		return sqlSessionTemplate.selectList(getSqlName("menuForRole"), sysMenuQuery);
	}

	@Override
	public List<SysMenuVo> getAll() {
		return sqlSessionTemplate.selectList(getSqlName("listAll"));
	}
}
